package com.snake.springboot.custom.service.port.adapter.feign;

import com.snake.springboot.custom.api.model.base.CustStrategySumModel;
import com.snake.springboot.custom.api.model.login.AccountCacheDelModel;
import com.snake.springboot.custom.api.model.login.VerifyImageModel;
import com.snake.springboot.custom.api.model.login.VerifyTextCodeModel;
import com.snake.springboot.custom.api.model.strategy.AuthBuyStrategyModel;
import com.snake.springboot.custom.api.request.auth.AuthorizationDefaultSave;
import org.snake.common.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "snake-authority")
public interface AuthFeignClient {

    /**校验图片*/
    @PostMapping("/authority/verify/verify_image")
    ResponseResult<Boolean> verifyImage(VerifyImageModel data);

    /**校验文字验证码*/
    @PostMapping("/authority/verify/verify_text_code")
    ResponseResult<Boolean> verifyTextCode(VerifyTextCodeModel data);

    /**
     * 删除账号缓存
     * @param model
     */
    @PostMapping("/authority/auth/used/del_cache")
    void delAccCache(@RequestBody AccountCacheDelModel model);

    /**
     * 添加默认权限
     * @param model
     */
    @PostMapping("/authority/auth/strategy-authorization/authorization-default")
    void authorizationDefault(@RequestBody AuthorizationDefaultSave model);

    @PostMapping("/authority/auth/strategy-authorization/strategy-sum")
    ResponseResult<List<CustStrategySumModel>> strategySum(@RequestBody List<String> data);

    /**授权部分权限策略-服务内部调用*/
    @PostMapping("/authority/auth/strategy-authorization/buy-author-inner")
    ResponseResult<Object> buyAuthorInner(@RequestBody List<AuthBuyStrategyModel> models);

    /**取消部分权限策略-服务内部调用*/
    @PostMapping("/authority/auth/strategy-authorization/cancel-buy-author-inner")
    ResponseResult<Object> cancelSomeAuthorInner(@RequestBody List<AuthBuyStrategyModel> models);


}
